# -*- coding:utf-8 -*-
from fastapi import Request,UploadFile
from core.curd import IBaseService
from app.dao.system import SysAttachDao

class SysAttachService(IBaseService):

    async def upload(self, file: UploadFile):
        return await self.dao.upload(file)

    async def download(self, path: str):
        return await self.dao.download(path)

    @classmethod
    async def instance(cls, req: Request):
        inst = cls()
        inst.dao = await SysAttachDao.instance(req)
        return inst
